package binary;
/** 二进制的演示 */
public class BinaryDemo {
    public static void main(String[] args) {
        int n = 45;
        System.out.println(Integer.toBinaryString(n)); //101101
        System.out.println(n); //45

        n++;
        System.out.println(Integer.toBinaryString(n)); //101110
        System.out.println(n); //46

        //0100 0111 1011 1001 1000 1010
        //  4    7    b    9    8    a

        //0010 1001 1011 0110 0011 0101
        //  2    9    b    6    3    5

        //1000 1111 0011 0101 1000 1001
        //  8    f    3     5   8    9

        // 0001 1100 0111 0100 0110 0000 1111
        //   1   c    7    4    6    0    f
    }
}
